<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人简历 - 张三</title>
    <link rel="stylesheet" href="../css/all.min.css">
    <script src="../js/html2canvas.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }
        
        :root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --accent-color: #e74c3c;
            --light-color: #ecf0f1;
            --dark-color: #34495e;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
            padding-bottom: 20px;
        }
        
        .container {
            margin: 0 auto;
            padding: 20px;
        }
        
        header {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 60px 20px;
            text-align: center;
            border-radius: 0 0 20px 20px;
            box-shadow: var(--shadow);
            margin-bottom: 30px;
            position: relative;
            overflow: hidden;
        }
        
        header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
            transform: rotate(30deg);
        }
        
        .profile-container {
            position: relative;
            display: inline-block;
            margin-bottom: 20px;
        }
        
        .profile-img {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            object-fit: cover;
            border: 5px solid rgba(255, 255, 255, 0.3);
            transition: var(--transition);
            cursor: pointer;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }
        
        .profile-img:hover {
            transform: scale(1.05);
            border-color: rgba(255, 255, 255, 0.6);
        }
        
        .upload-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: var(--transition);
            cursor: pointer;
        }
        
        .profile-container:hover .upload-overlay {
            opacity: 1;
        }
        
        .upload-text {
            color: white;
            font-size: 0.9rem;
            text-align: center;
            padding: 10px;
        }
        
        #photo-upload {
            display: none;
        }
        
        h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
        }
        
        .title {
            font-size: 1.2rem;
            opacity: 0.9;
            margin-bottom: 20px;
        }
        
        .contact-info {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 15px;
            margin-top: 20px;
        }
        
        .contact-item {
            background: rgba(255, 255, 255, 0.2);
            padding: 8px 15px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
            backdrop-filter: blur(5px);
            transition: var(--transition);
        }
        
        .contact-item:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }
        
        /* 主要内容区域 */
        .main-content {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 30px;
        }
        
        @media (max-width: 768px) {
            .main-content {
                grid-template-columns: 1fr;
            }
        }
        
        /* 卡片样式 */
        .card {
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: var(--shadow);
            margin-bottom: 25px;
            transition: var(--transition);
            border-left: 4px solid var(--primary-color);
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        }
        
        .card-title {
            color: var(--secondary-color);
            font-size: 1.5rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--light-color);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .card-title i {
            color: var(--primary-color);
        }
        
        /* 技能标签样式 */
        .skills-container {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
        }
        
        .skill-tag {
            background: linear-gradient(135deg, var(--primary-color), #2980b9);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: var(--transition);
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
        }
        
        .skill-tag:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
        }
        
        .skill-tag.advanced {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
        }
        
        .skill-tag.intermediate {
            background: linear-gradient(135deg, #f39c12, #e67e22);
        }
        
        .skill-tag.beginner {
            background: linear-gradient(135deg, #2ecc71, #27ae60);
        }
        
        /* 证书样式 */
        .certificates-container {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        
        .certificate-item {
            background: white;
            border-radius: 10px;
            padding: 15px;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
            border-left: 4px solid #9b59b6;
            transition: var(--transition);
        }
        
        .certificate-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
        }
        
        .certificate-title {
            font-weight: bold;
            color: var(--secondary-color);
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .certificate-issuer {
            color: #666;
            font-size: 0.9rem;
            margin-bottom: 5px;
        }
        
        .certificate-date {
            color: #999;
            font-size: 0.8rem;
        }
        
        /* 时间线样式 */
        .timeline {
            position: relative;
            padding-left: 30px;
        }
        
        .timeline::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 2px;
            background-color: var(--primary-color);
        }
        
        .timeline-item {
            position: relative;
            margin-bottom: 25px;
        }
        
        .timeline-item::before {
            content: '';
            position: absolute;
            left: -36px;
            top: 5px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background-color: var(--primary-color);
            border: 3px solid white;
            box-shadow: 0 0 0 2px var(--primary-color);
        }
        
        .timeline-date {
            color: var(--accent-color);
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .timeline-title {
            font-weight: bold;
            margin-bottom: 5px;
            color: var(--secondary-color);
        }
        
        .timeline-subtitle {
            color: var(--dark-color);
            margin-bottom: 8px;
            font-style: italic;
        }
        
        .project-grid {
            display: flex;
            gap: 20px;
            flex-direction: column;
        }
        
        .project-card {
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
            border-top: 4px solid var(--primary-color);
            padding: 20px;
        }
        
        .project-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        }
        
        .project-content {
            padding: 0;
        }
        
        .project-title {
            font-size: 1.2rem;
            margin-bottom: 10px;
            color: var(--secondary-color);
        }
        
        .project-description {
            color: #666;
            margin-bottom: 15px;
        }
        
        .project-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .tag {
            background-color: var(--light-color);
            color: var(--dark-color);
            padding: 4px 10px;
            border-radius: 15px;
            font-size: 0.8rem;
        }
        
        .action-buttons {
            position: fixed;
            right: 30px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: column;
            gap: 15px;
            z-index: 100;
        }
        
        .action-btn {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            border-radius: 50px;
            padding: 12px 20px;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            transition: var(--transition);
        }
        
        .action-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
        }
        
        .action-btn:active {
            transform: translateY(1px);
        }
        
        .action-btn.print {
            background: linear-gradient(135deg, #2ecc71, #27ae60);
        }
        
        .action-btn.export {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
        }
        
        @media print {
            .card {
                box-shadow: none;
                border: 1px solid #ddd;
            }
            
            header {
                background: #f0f0f0 !important;
                color: #333;
            }
            
            .contact-item {
                background: #f0f0f0;
            }
            
            .action-buttons {
                display: none !important;
            }
        }
        
        @media (max-width: 1100px) {
            .action-buttons {
                position: static;
                transform: none;
                flex-direction: row;
                justify-content: center;
                margin-top: 20px;
            }
        }
        
        .toast {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 12px 20px;
            border-radius: 5px;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 导出图片时隐藏按钮的样式 */
        .hide-for-export .action-buttons {
            display: none !important;
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <div class="profile-container">
                <img src="" alt="个人照片" class="profile-img" id="profile-pic">
                <div class="upload-overlay" id="upload-trigger">
                    <div class="upload-text">
                        <i class="fas fa-camera"></i><br>
                        点击上传照片
                    </div>
                </div>
                <input type="file" id="photo-upload" accept="image/*">
            </div>
            <h1 contenteditable="true">张三</h1>
            <p class="title" contenteditable="true">前端开发工程师</p>
            <p contenteditable="true">专注于创建优雅、高效的Web应用，拥有5年开发经验</p>
            <div class="contact-info">
                <div class="contact-item">
                    <i class="fas fa-envelope"></i>
                    <span contenteditable="true">zhangsan@example.com</span>
                </div>
                <div class="contact-item">
                    <i class="fas fa-phone"></i>
                    <span contenteditable="true">138-0000-0000</span>
                </div>
                <div class="contact-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <span contenteditable="true">北京市朝阳区</span>
                </div>
            </div>
        </div>
    </header>
    
    <div class="container">
        <div class="main-content">
            <!-- 左侧栏 -->
            <div class="sidebar">
                <!-- 技能 -->
                <div class="card">
                    <h2 class="card-title">
                        <i class="fas fa-code"></i>
                        专业技能
                    </h2>
                    <div class="skills-container">
                        <div class="skill-tag advanced" contenteditable="true">
                            <i class="fab fa-html5"></i>
                            HTML/CSS
                        </div>
                        <div class="skill-tag advanced" contenteditable="true">
                            <i class="fab fa-js"></i>
                            JavaScript
                        </div>
                        <div class="skill-tag advanced" contenteditable="true">
                            <i class="fab fa-vuejs"></i>
                            Vue.js
                        </div>
                        <div class="skill-tag intermediate" contenteditable="true">
                            <i class="fab fa-react"></i>
                            React
                        </div>
                        <div class="skill-tag intermediate" contenteditable="true">
                            <i class="fab fa-node-js"></i>
                            Node.js
                        </div>
                        <div class="skill-tag intermediate" contenteditable="true">
                            <i class="fas fa-database"></i>
                            MySQL
                        </div>
                        <div class="skill-tag beginner" contenteditable="true">
                            <i class="fab fa-python"></i>
                            Python
                        </div>
                        <div class="skill-tag intermediate" contenteditable="true">
                            <i class="fab fa-git"></i>
                            Git
                        </div>
                    </div>
                </div>
                
                <!-- 资质证书 -->
                <div class="card">
                    <h2 class="card-title">
                        <i class="fas fa-award"></i>
                        资质证书
                    </h2>
                    <div class="certificates-container">
                        <div class="certificate-item">
                            <div class="certificate-title" contenteditable="true">
                                <i class="fas fa-certificate"></i>
                                Web前端开发工程师认证
                            </div>
                            <div class="certificate-issuer" contenteditable="true">中国软件行业协会</div>
                            <div class="certificate-date" contenteditable="true">2022年6月</div>
                        </div>
                        <div class="certificate-item">
                            <div class="certificate-title" contenteditable="true">
                                <i class="fas fa-certificate"></i>
                                Vue.js高级开发者认证
                            </div>
                            <div class="certificate-issuer" contenteditable="true">Vue官方认证中心</div>
                            <div class="certificate-date" contenteditable="true">2021年12月</div>
                        </div>
                        <div class="certificate-item">
                            <div class="certificate-title" contenteditable="true">
                                <i class="fas fa-certificate"></i>
                                全国计算机等级考试四级
                            </div>
                            <div class="certificate-issuer" contenteditable="true">教育部考试中心</div>
                            <div class="certificate-date" contenteditable="true">2020年9月</div>
                        </div>
                    </div>
                </div>
                
                <!-- 关于我 -->
                <div class="card">
                    <h2 class="card-title">
                        <i class="fas fa-user"></i>
                        关于我
                    </h2>
                    <p contenteditable="true">热爱技术的前端开发工程师，擅长使用Vue.js和React构建现代化Web应用。注重代码质量和用户体验，乐于学习新技术并应用于实际项目中。</p>
                </div>
            </div>
            
            <!-- 右侧内容 -->
            <div class="content">
                <!-- 教育背景 -->
                <div class="card">
                    <h2 class="card-title">
                        <i class="fas fa-graduation-cap"></i>
                        教育背景
                    </h2>
                    <div class="timeline">
                        <div class="timeline-item">
                            <div class="timeline-date" contenteditable="true">2013.09 - 2017.06</div>
                            <div class="timeline-title" contenteditable="true">计算机科学与技术 学士</div>
                            <div class="timeline-subtitle" contenteditable="true">XX大学</div>
                            <p contenteditable="true">主修课程：数据结构、算法设计、Web开发、数据库原理、软件工程等。</p>
                        </div>
                    </div>
                </div>
                
                <!-- 工作经历 -->
                <div class="card">
                    <h2 class="card-title">
                        <i class="fas fa-briefcase"></i>
                        工作经历
                    </h2>
                    <div class="timeline">
                        <div class="timeline-item">
                            <div class="timeline-date" contenteditable="true">2020.03 - 至今</div>
                            <div class="timeline-title" contenteditable="true">高级前端开发工程师</div>
                            <div class="timeline-subtitle" contenteditable="true">ABC科技有限公司</div>
                            <p contenteditable="true">负责公司核心产品的前端架构设计和开发，带领5人前端团队，优化项目性能，提升用户体验。</p>
                        </div>
                        <div class="timeline-item">
                            <div class="timeline-date" contenteditable="true">2018.06 - 2020.02</div>
                            <div class="timeline-title" contenteditable="true">前端开发工程师</div>
                            <div class="timeline-subtitle" contenteditable="true">XYZ互联网公司</div>
                            <p contenteditable="true">参与多个大型项目的前端开发，使用Vue.js和React技术栈，与后端团队协作实现产品功能。</p>
                        </div>
                        <div class="timeline-item">
                            <div class="timeline-date" contenteditable="true">2017.07 - 2018.05</div>
                            <div class="timeline-title" contenteditable="true">前端开发实习生</div>
                            <div class="timeline-subtitle" contenteditable="true">创新软件公司</div>
                            <p contenteditable="true">学习并参与公司项目开发，掌握HTML、CSS、JavaScript等前端技术，积累项目开发经验。</p>
                        </div>
                    </div>
                </div>
                
                <!-- 项目经验 -->
                <div class="card">
                    <h2 class="card-title">
                        <i class="fas fa-project-diagram"></i>
                        项目经验
                    </h2>
                    <div class="project-grid">
                        <div class="project-card">
                            <div class="project-content">
                                <h3 class="project-title" contenteditable="true">企业管理系统</h3>
                                <p class="project-description" contenteditable="true">基于Vue.js和Element UI开发的企业内部管理系统，包含员工管理、任务分配、数据统计等功能。</p>
                                <div class="project-tags">
                                    <span class="tag" contenteditable="true">Vue.js</span>
                                    <span class="tag" contenteditable="true">Element UI</span>
                                    <span class="tag" contenteditable="true">Axios</span>
                                </div>
                            </div>
                        </div>
                        <div class="project-card">
                            <div class="project-content">
                                <h3 class="project-title" contenteditable="true">电商平台前端</h3>
                                <p class="project-description" contenteditable="true">使用React和Ant Design构建的电商平台前端，实现了商品展示、购物车、订单管理等功能。</p>
                                <div class="project-tags">
                                    <span class="tag" contenteditable="true">React</span>
                                    <span class="tag" contenteditable="true">Ant Design</span>
                                    <span class="tag" contenteditable="true">Redux</span>
                                </div>
                            </div>
                        </div>
                        <div class="project-card">
                            <div class="project-content">
                                <h3 class="project-title" contenteditable="true">数据可视化平台</h3>
                                <p class="project-description" contenteditable="true">基于ECharts的数据可视化平台，支持多种图表类型，提供数据导入、分析和导出功能。</p>
                                <div class="project-tags">
                                    <span class="tag" contenteditable="true">JavaScript</span>
                                    <span class="tag" contenteditable="true">ECharts</span>
                                    <span class="tag" contenteditable="true">Node.js</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <div class="action-buttons">
        <button class="action-btn print" id="print-btn">
            <i class="fas fa-print"></i>
            简历打印
        </button>
        <button class="action-btn export" id="export-btn">
            <i class="fas fa-image"></i>
            导出长图
        </button>
    </div>
    
    <div class="toast" id="toast"></div>
    
    <script>
        // 照片上传功能
        document.addEventListener('DOMContentLoaded', function() {
            const photoUpload = document.getElementById('photo-upload');
            const profilePic = document.getElementById('profile-pic');
            const uploadTrigger = document.getElementById('upload-trigger');
            const printBtn = document.getElementById('print-btn');
            const exportBtn = document.getElementById('export-btn');
            const toast = document.getElementById('toast');
            
            // 点击照片或上传区域触发文件选择
            profilePic.addEventListener('click', function() {
                photoUpload.click();
            });
            
            uploadTrigger.addEventListener('click', function() {
                photoUpload.click();
            });
            
            // 处理文件选择并转换为Base64
            photoUpload.addEventListener('change', function(e) {
                const file = e.target.files[0];
                if (file) {
                    const reader = new FileReader();
                    
                    reader.onload = function(event) {
                        profilePic.src = event.target.result;
                        // 这里可以保存Base64数据到变量或发送到服务器
                        const base64Data = event.target.result;
                        console.log('图片Base64数据:', base64Data.substring(0, 100) + '...');
                        showToast('照片上传成功并已转换为Base64格式');
                    }
                    
                    reader.readAsDataURL(file);
                }
            });
            
            // 添加编辑提示
            const editableElements = document.querySelectorAll('[contenteditable="true"]');
            editableElements.forEach(el => {
                el.addEventListener('focus', function() {
                    this.dataset.original = this.innerHTML;
                });
                
                el.addEventListener('blur', function() {
                    if (this.innerHTML.trim() === '') {
                        this.innerHTML = this.dataset.original || '点击编辑内容';
                    }
                });
            });
            
            // 打印功能
            printBtn.addEventListener('click', function() {
                window.print();
                showToast('正在打开打印对话框...');
            });
            
            // 导出长图功能
            exportBtn.addEventListener('click', function() {
                
                // 添加隐藏按钮的类
                document.body.classList.add('hide-for-export');
                
                // 使用html2canvas将页面转换为图片
                html2canvas(document.body, {
                    scale: 2, // 提高图片质量
                    useCORS: true,
                    allowTaint: true,
                    scrollY: -window.scrollY
                }).then(canvas => {
                    // 创建下载链接
                    const link = document.createElement('a');
                    link.download = '个人简历.png';
                    link.href = canvas.toDataURL('image/png');
                    link.click();
                    
                    // 移除隐藏按钮的类
                    document.body.classList.remove('hide-for-export');
                    
                }).catch(err => {
                    // 移除隐藏按钮的类
                    document.body.classList.remove('hide-for-export');
                    showToast('生成图片失败，请重试');
                });
            });
            
            // 显示提示信息
            function showToast(message) {
                toast.textContent = message;
                toast.classList.add('show');
                
                setTimeout(() => {
                    toast.classList.remove('show');
                }, 3000);
            }
        });
    </script>
</body>
</html>